<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String root = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>Corey分享自由----发表文章</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">

		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<style type="text/css">
<!--
.write_panel {
	margin-left: 100px;
	width:700px;
	overflow:hidden;
}

.write_panel table td {
	font-size: 12px;
}

.write_panel table {
	border: 1px SOLID #eeeeee;
}

.write_panel textarea {
	width: 100%;
}

.write_panel .fill {
	width: 100%;
	border: 1px SOLID #888888;
	background-color: transparent;
}

.write_panel .label {
	font-size: 12px;
	font-weight: BOLD;
}

.write_panel .btn {
	border: 1px SOLID #888888;
	padding: 2px 2px 2px 2px;
}

.write_panel .catogory_selector{
	height:20px;
	width:20px;
	background:transparent url(<%=root%>/images/catogory.gif) scroll no-repeat top left);
	cursor:hand;
}
.write_panel .insert_image{
	height:20px;
	width:20px;
	background:transparent url(<%=root%>/images/upload.gif) scroll no-repeat top left);
	cursor:hand;
}

-->
</style>
		<script type="text/javascript"
			src="<%=root%>/scripts/jquery-1.3.2.min.js"></script>
		<script type="text/javascript"
			src="<%=root%>/scripts/xheditor-zh-cn.js"></script>
		<script type="text/javascript"
			src="<%=root%>/scripts/jquery.processbar.js"></script>
		<script type="text/javascript">
	<!--
		var pb;
		
		function showProcessbar(){
			if(pb!=undefined){
				pb.show();
			}
		}
		
		function hideProcessbar(){
			if(pb!=undefined){
				pb.hide();
			}
		}
		
		$(function(){
			var editor=$('.editor').xheditor(true,{skin:'o2007blue'})[0].objxhe;
			pb=$('#PB').processBar({timeout:5000});
			$('.insert_image').live('click',function(e){
				var imgSrc=$(this).prev().prev().attr('href');
				var html="<img src='"+imgSrc+"'/>"
				editor.pasteHTML(html);
			});
		});
		
		function frameHeightSync(height){
			$('#file_upload').height($('#file_upload').height()+height);
			if(window.parent!=undefined){
				window.parent.frameHeightSync(height+5);
			}
		}
		
		function showFilesInfo(filesInfo){
			for(var index=0;index<filesInfo.length;index++){
				var fileInfo=filesInfo[index];
				var fileName=fileInfo.fileName==undefined?"":fileInfo.fileName;
				var fileSize=fileInfo.fileSize==undefined?0:fileInfo.fileSize;
				var fileId=fileInfo.fileSize==undefined?0:fileInfo.fileId;
				var href="<%=root%>/system/fileShower.action?id="+fileId;
				var template="<div><a href=':href' target='blank'>:fileName</a><span>:fileSizeK</span><span class='insert_image'></span></div>";
				var appendHTML=template.replace(":href",href).replace(':fileName',fileName).replace(':fileSize',fileSize);
				$('#filesInfo').append(appendHTML);
			}
			hideProcessbar();
		}
		
	-->
	</script>
	</head>

	<body>
		<div id="PB" style="display:none;height:50px;width:32px;background:transparent url(/images/13221820.gif) scroll no-repeat left 18;position:absolute;top:570px;left:80px"></div>
		<form action="<%=root%>/admin/articleWrite.action" method="post">
			<input type="hidden" name="article.id" />
			<div class="write_panel">
				<table>
					<tr>
						<td width="50px"></td>
						<td width="80px"></td>
						<td width="80px"></td>
						<td width="80px"></td>
						<td width="100px"></td>
						<td width="100px"></td>
						<td width="100px"></td>
						<td width="300px"></td>
					</tr>
					<tr>
						<td class="label">
							标题
						</td>
						<td colspan="5">
							<input type="text" name="article.title" class="fill title_input" />
						</td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td colspan="8"></td>
					</tr>
					<tr>
						<td class="label">
							关键词
						</td>
						<td colspan="5">
							<input type="text" name="article.keywords"
								class="fill keywords_input" />
						</td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td colspan="8"></td>
					</tr>
					<tr>
						<td class="label">
							分类
						</td>
						<td colspan="3">
							<select name="article.catogory"
								class="fill catogory_input">
								<option>请选择分类</option>
								<s:iterator value="catogories" id="catogory" status="s">
									<option value='<s:property value="#catogory.id"/>'><s:property value="#catogory.name"/></option>
								</s:iterator>
							</select>
						</td>
						<td class="label">
							<span class="catogory_selector"></span>
						</td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td colspan="8"></td>
					</tr>
					<tr>
						<td class="label">
							类型
						</td>
						<td>
							<input type="radio" value="0" name="article.type" />
							原创
						</td>
						<td>
							<input type="radio" value="1" name="article.type" />
							转帖
						</td>
						<td>
							<input type="radio" value="2" name="article.type" />
							翻译
						</td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td colspan="8"></td>
					</tr>
					<tr>
						<td class="label">
							置顶
						</td>
						<td>
							<input type="checkbox" value="true" name="article.isTop" />
							置顶
						</td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td colspan="8"></td>
					</tr>
					<tr>
						<td colspan="8">
							<textarea name="article.text" rows="" cols="" class="editor"
								style="height: 400px"></textarea>
						</td>
					</tr>
					<tr>
						<td colspan="8"></td>
					</tr>
					
					<tr>
						<td colspan="8"></td>
					</tr>
					<tr>
						<td class="label" colspan="2">
							已传附件
						</td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td colspan="2" id="filesInfo">
						</td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td class="label" colspan="2">
							附件上传
						</td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td colspan="5">
							<iframe id="file_upload"
								src="<%=root%>/admin/admin_attachements_upload.jsp" width="100%"
								height=100 frameborder="0"></iframe>
						</td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td class="label">
							摘要
						</td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td colspan="8"></td>
					</tr>
					<tr>
						<td colspan="8">
							<textarea name="article.summary" rows="" cols=""
								style="height: 200px"></textarea>
						</td>
					</tr>
					<tr>
						<td colspan="8"></td>
					</tr>
					<tr>
						<td colspan="8"></td>
					</tr>
					<tr>
						<td colspan="3">
							<input type="submit" class="btn" value="发表" />
						</td>
						<td colspan="5">
							<input type="reset" class="btn" value="取消" />
						</td>
					</tr>
				</table>
			</div>
		</form>
	</body>
</html>
